package com.magicalcoder.youyamvc.app.goodsspeccategory.dao.impl;

import com.magicalcoder.youyamvc.app.goodsspeccategory.dao.GoodsSpecCategoryDao;
import com.magicalcoder.youyamvc.app.model.GoodsSpecCategory;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
* 代码为自动生成 Created by www.magicalcoder.com
* 如果你改变了此类 read 请将此行删除
*  欢迎加入官方QQ群:323237052
*/

@Component("goodsSpecCategoryDao")
public class GoodsSpecCategoryDaoImpl   implements GoodsSpecCategoryDao {

    @Resource(name="sqlSessionTemplate")
    private  SqlSessionTemplate  sqlSessionTemplate;
    @Override
    public GoodsSpecCategory getGoodsSpecCategory(Map<String, Object> query) {
        return sqlSessionTemplate.selectOne("GoodsSpecCategoryMapper.getGoodsSpecCategory",query);
    }
    @Override
    public List<GoodsSpecCategory> getGoodsSpecCategoryList(Map<String, Object> query) {
        return sqlSessionTemplate.selectList("GoodsSpecCategoryMapper.getGoodsSpecCategoryList", query);
    }
    @Override
    public Integer getGoodsSpecCategoryListCount(Map<String, Object> query) {
        return sqlSessionTemplate.selectOne("GoodsSpecCategoryMapper.getGoodsSpecCategoryListCount", query);
    }

    @Override
    public void batchInsertGoodsSpecCategory(List<GoodsSpecCategory> list) {
        sqlSessionTemplate.insert("GoodsSpecCategoryMapper.batchInsertGoodsSpecCategory",list);
    }

    @Override
    public void batchUpdateGoodsSpecCategory(List<GoodsSpecCategory> list) {
        sqlSessionTemplate.update("GoodsSpecCategoryMapper.batchUpdateGoodsSpecCategory",list);
    }

    @Override
    public     Long  insertGoodsSpecCategory(GoodsSpecCategory entity) {
        sqlSessionTemplate.insert("GoodsSpecCategoryMapper.insertGoodsSpecCategory",entity);
  return entity.getId();    }
    @Override
    public void updateGoodsSpecCategory(GoodsSpecCategory entity) {
        sqlSessionTemplate.update("GoodsSpecCategoryMapper.updateGoodsSpecCategory", entity);
    }
    @Override
    public void updateGoodsSpecCategoryWithoutNull(GoodsSpecCategory entity) {
        sqlSessionTemplate.update("GoodsSpecCategoryMapper.updateGoodsSpecCategoryWithoutNull", entity);
    }
    @Override
    public void updateGoodsSpecCategoryByWhereSql(Map<String,Object> entity) {
        sqlSessionTemplate.update("GoodsSpecCategoryMapper.updateGoodsSpecCategoryByWhereSql", entity);
    }
    @Override
    public void truncateGoodsSpecCategory() {
        sqlSessionTemplate.delete("GoodsSpecCategoryMapper.truncateGoodsSpecCategory");
    }
    @Override
    public void deleteGoodsSpecCategory(Map<String, Object> query) {
        sqlSessionTemplate.delete("GoodsSpecCategoryMapper.deleteGoodsSpecCategory",query);
    }
    @Override
    public void deleteGoodsSpecCategoryList(Map<String, Object> query) {
        sqlSessionTemplate.delete("GoodsSpecCategoryMapper.deleteGoodsSpecCategoryList",query);
    }
    @Override
    public void deleteGoodsSpecCategoryByWhereSql(Map<String, Object> query) {
        sqlSessionTemplate.delete("GoodsSpecCategoryMapper.deleteGoodsSpecCategoryByWhereSql",query);
    }
    @Override
    public void batchDeleteGoodsSpecCategory(List<Long> list) {
        sqlSessionTemplate.delete("GoodsSpecCategoryMapper.batchDeleteGoodsSpecCategory",list);
    }
    @Override
    public void batchDeleteGoodsSpecCategoryList(List<GoodsSpecCategory> list) {
        sqlSessionTemplate.delete("GoodsSpecCategoryMapper.batchDeleteGoodsSpecCategoryList",list);
    }

}
